<template>
	<view class="container" @click="$u.route('/pages/public/login')">
		<!-- <image src="/static/participate.png"></image> -->
		<canvas canvas-id="canvasId" :style="{width: width * 375 + 'px',height: height + 'px'}"></canvas>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				height: 0,
				width: 0
			}
		},

		onLoad() {
			this.getWindowInfo()
			if (this.isLogin) return uni.switchTab({
				url: '/pages/index/index'
			})
		},
		methods: {
			getWindowInfo() {
				let platform = uni.getDeviceInfo().platform
				this.height = uni.getSystemInfoSync().windowHeight;
				this.width = uni.getSystemInfoSync().windowWidth / 375;
				let canvas = uni.createCanvasContext('canvasId')
				canvas.drawImage(platform == 'windows' ? '/static/participate2.png' : '/static/participate.png', 0, 0, this.width * 375, this.height)
				canvas.draw()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		height: 100vh;
		width: 750rpx;
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>